package org.mysfit.ctp4j;

import java.io.IOException;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;

@EnableAutoConfiguration
@EnableConfigurationProperties
@SpringBootApplication(scanBasePackages = {"org.mysfit.ctp4j"})
@MapperScan("org.mysfit.ctp4j.infra.mapper")
public class Ctp4jApplication {
	private static final Logger LOGGER = LoggerFactory.getLogger(Ctp4jApplication.class);
	
	static{
		try {
			LoadLibrary.loadCtp("6.6.1_P1");
		} catch (IOException e) {
			LOGGER.error("load library fail:{}", e.getMessage());
		}
    }
	
	public static void main(String[] args) {
		SpringApplication.run(Ctp4jApplication.class, args);
		System.err.println("http://127.0.0.1:8080/v2/api-docs");
	}

}
